package com.hsp.Demo_11_innerclass;

public class Outter06 {
    public static void main(String[] args) {
        CellPhone ce = new CellPhone();
        ce.clock(new Bell(){
            @Override
            public void ring(int a) {
                System.out.println("懒猪，起床啦");
            }
        });

        ce.clock(new Bell(){
            @Override
            public void ring(int a) {
                System.out.println("傻子，起床啦");
            }
        });

        ce.clock((b)->{
            int i = 10;
            System.out.println(i + "傻子，起床啦！");
        });
    }
}

interface Bell{
    void ring(int a);
}

class CellPhone {
    public void clock(Bell bell){
        int a = 1;
        bell.ring(a);
    }
}
